/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 分页查询产品类别 GET /product_category */
export async function productCategoryGetCategoryPage({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductCategoryGetCategoryPageParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelProductCategoryModel_>(
    '/product_category',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 编辑产品类别 PUT /product_category */
export async function productCategoryEditCategory({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductCategoryEditCategoryParams;
  body: API.AddOrEditProductCategoryModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/product_category', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增产品类别 POST /product_category */
export async function productCategoryAddCategory({
  body,
  options,
}: {
  body: API.AddOrEditProductCategoryModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/product_category', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除产品类别 DELETE /product_category */
export async function productCategoryDeleteCategory({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ProductCategoryDeleteCategoryParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/product_category', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询产品类别列表 GET /product_category/list */
export async function productCategoryGetCategoryList({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListString_>('/product_category/list', {
    method: 'GET',
    ...(options || {}),
  });
}
